<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        *{margin: 0;padding: 0;}
        .box{
            width: 490px;
            height: 490px;
            border: 5px solid gray;
            position: relative;
            margin: 0 auto;
            transform-style: preserve-3d; 
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            /* transform: rotate3d(1, 1, 1, 30deg); */

            animation: run 6s linear infinite;
            /* animation: onetosix 18s linear infinite; */
            /* animation: hahaha 10s linear infinite; */
        }
        @keyframes run {
            0%{
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
            33.33%{
            transform: rotateX(120deg) rotateY(120deg) rotateZ(120deg);
            }
            66.66%{
            transform: rotateX(240deg) rotateY(240deg) rotateZ(240deg);
            }
            100%{
            transform: rotateX(360deg) rotateY(360deg) rotateZ(36 0deg);
            }
        }
        @keyframes onetosix {
            0%{
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
            14.3%{
            transform: rotateX(180deg) rotateY(0deg) rotateZ(0deg);
            }
            28.6%{
            transform: rotateX(0deg) rotateY(180deg) rotateZ(-180deg);
            }
            52.9%{
            transform: rotateX(180deg) rotateY(270deg) rotateZ(-180deg);
            }
            57.2%{
            transform: rotateX(90deg) rotateY(90deg) rotateZ(-90deg);
            }
            71.5%{
            transform: rotateX(270deg) rotateY(180deg) rotateZ(180deg);
            }
            85.8%{
            transform: rotateX(90deg) rotateY(180deg) rotateZ(180deg);
            }
            100%{
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
        }
        @keyframes hahaha {
            0%{
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
            10%{
            transform: rotateX(45deg) rotateY(-10deg) rotateZ(20deg);
            }
            22%{
            transform: rotateX(99deg) rotateY(120deg) rotateZ(-60deg);
            }
            35%{
            transform: rotateX(-88deg) rotateY(233deg) rotateZ(-150deg);
            }
            52%{
            transform: rotateX(222deg) rotateY(158deg) rotateZ(-70deg);
            }
            60%{
            transform: rotateX(123deg) rotateY(66deg) rotateZ(199deg);
            }
            78%{
            transform: rotateX(-60deg) rotateY(-120deg) rotateZ(-210deg);
            }
            90%{
            transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
        }
        .box div{
            width: 200px;
            height: 200px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -100px;
            margin-top: -100px;
            line-height: 200px;
            text-align: center;
            font-size: 49px;
            opacity: .81;
        }
        .box div:nth-child(1){
            background-color: palegreen;
            transform: translateZ(100px);
        }
        .box div:nth-child(2){
            background-color: salmon;
            transform: translateZ(-100px) rotateX(180deg);
        }
        .box div:nth-child(3){
            background-color: rebeccapurple;
            transform: translateX(100px) rotateY(90deg);
        }
        .box div:nth-child(4){
            background-color: red;
            transform: translateX(-100px) rotateY(-90deg);
        }
        .box div:nth-child(5){
            background-color: darkblue;
            transform: translateY(100px) rotateX(-90deg);
        }
        .box div:nth-child(6){
            background-color: olive;
            transform: translateY(-100px) rotateX(90deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
    </div>
</body>
</html>